<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="wangbo">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- <link rel="stylesheet" type="text/css" href=""/> -->
    <title> 虚拟dom </title>
</head>
<body>
    <div id="app">
    	
    </div>
    <script type="text/javascript" src="../js/react.development.js" >    </script>
	<script type="text/javascript" src="../js/react-dom.development.js" >    </script>
	<script type="text/javascript" src="../js/prop-types.js" >    </script>
	<script type="text/javascript" src="../js/babel.min.js" >    </script>
	<script type="text/babel">
	class Vdom extends React.Component {
		constructor(props) {
			super(props)
			this.state={
				date:new Date()
			}
		}
		componentDidMount () {
		    setInterval(() => {
		      this.setState({
		          date: new Date()
		      })
		    }, 1000)
		}
		render(){
			return(
				<div>
					请输入名字<input type="text" />
					这是日期 {this.state.date.toTimeString()}
				</div>
			)
		}
	}
	ReactDOM.render(<Vdom />,document.getElementById("app"));
	</script>
</body>
</html>
